import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'
import Doki from '../views/Doki/Doki.vue'
import Msite from '../views/Msite/Msite.vue'
import Vip from '../views/Vip/Vip.vue'
import Search from '../views/Search/Search.vue'
import SearchOther from '../views/Search/SearchOther.vue'
import Channel from '../views/Channel/Channel.vue'
import Login from '../views/Login/Login.vue'
import NoteLogin from '../views/Login/NoteLogin.vue'
import PasswordLogin from '../views/Login/PasswordLogin.vue'
import Novel from '../views/Novel/Novel.vue'
import Detail from '../views/Novel/Detail.vue'
// 路由器
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/doki',
    component: Doki,
    meta: {
      showFooter: true
    }
  },
  {
    path: '/novel',
    component: Novel
  },
  {
    name: 'detail',
    path: '/detail',
    component: Detail
  },
  {
    path: '/msite',
    name: 'msite',
    component: Msite,
    meta: {
      showFooter: true
    }
  },
  {
    path: '/vip',
    component: Vip,
    meta: {
      showFooter: true
    }
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    meta: {
      showFooter: true
    }
  },
  {
    path: '/search',
    name: 'search',
    component: Search
  },
  {
    path: '/searchother',
    name: 'searchother',
    component: SearchOther,
    meta: {
      showFooter: true
    }
  },
  {
    path: '/channel',
    name: 'channel',
    component: Channel
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    children: [
      {
        name: 'noteLogin',
        path: 'noteLogin',
        component: NoteLogin
      },
      {
        name: 'passwordLogin',
        path: 'passwordLogin',
        component: PasswordLogin
      },
      {
        path: '/login',
        redirect: 'noteLogin'
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
